// 产品碳足迹接口
import request from '@/utils/request'

// 获取所有的产品
export function getAllProduct(query) {
  return request({
    url: '/product/management/list',
    method: 'get',
    params: query
  })
}

// 获得产品分页
export function getProductByPage(query) {
  return request({
    url: '/product/management/page',
    method: 'get',
    params: query
  })
}

// 创建产品
export function createProduct(data) {
  return request({
    url: '/product/management/create',
    method: 'POST',
    data: data
  })
}

// 创建排放源
export function createEmission(data) {
  return request({
    url: '/product/emission-source/create',
    method: 'POST',
    data: data
  })
}

// 获得排放源分页
export function getEmissionByPage(query) {
  return request({
    url: '/product/emission-source/page',
    method: 'get',
    params: query
  })
}

// 获得工序列表
export function getProcessByPage(query) {
  return request({
    url: '/product/process/page',
    method: 'get',
    params: query
  })
}

// 创建工序
export function createProcess(data) {
  return request({
    url: '/product/process/create',
    method: 'POST',
    data: data
  })
}

// 排放源-工序关联
export function linkEmissionAndProcess(data) {
  return request({
    url: '/product/emission-process/create',
    method: 'POST',
    data: data
  })
}

// 获得排放源-工序关联
export function getEmissionAndProcess(query) {
  return request({
    url: '/product/emission-process/get',
    method: 'get',
    params: query
  })
}

// 创建核算模型
export function createCalculationModel(data) {
  return request({
    url: '/product/calculation-model/create',
    method: 'POST',
    data: data
  })
}

// 创建工序-模型关联
export function linkProcessAndModel(data) {
  return request({
    url: '/product/process-model/create',
    method: 'POST',
    data: data
  })
}

// 创建产品碳核算
export function createCalculation(data) {
  return request({
    url: '/product/calculation/create',
    method: 'POST',
    data: data
  })
}

// 获得核算模型分页
export function getModelByPage(data) {
  return request({
    url: '/product/calculation-model/page',
    method: 'get',
    data: data
  })
}

// 更新产品碳核算
export function updateCalculation(data) {
  return request({
    url: '/product/calculation/update',
    method: 'POST',
    data: data
  })
}

// 创建核算报告
export function createReport(data) {
  return request({
    url: '/product/report/create',
    method: 'POST',
    data: data
  })
}


// 获得工序-模型关联
export function getProcessModel(query) {
  return request({
    url: '/product/process-model/get',
    method: 'get',
    params: query
  })
}

// 获得产品碳核算分页
export function getCalculationByPage(query) {
  return request({
    url: '/product/calculation/page',
    method: 'get',
    params: query
  })
}

// 获得产品碳核算详细信息
export function getCalculationDetail(query) {
  return request({
    url: '/product/calculation/getDetails',
    method: 'get',
    params: query
  })
}

// 创建排放源-核算关联
export function createEmissionAndCalculation(data) {
  return request({
    url: '/product/emission-calculation/create',
    method: 'POST',
    data: data
  })
}

// 推荐排放源
export function getEmissionRecommend(query) {
  return request({
    url: '/product/emission-source/recommend',
    method: 'get',
    params: query
  })
}

// 创建核算报告
export function createReportNew(data) {
  return request({
    url: '/product/report/create',
    method: 'POST',
    data: data
  })
}

// 获得核算报告分页
export function getReportByPage(query) {
  return request({
    url: '/product/report/page',
    method: 'get',
    params: query
  })
}

// 创建报告下载
export function createReportDownLoad(data) {
  return request({
    url: '/product/report-download/create',
    method: 'POST',
    data: data
  })
}
